package chapter9.practice;

/**
 * @Author juzipi
 * @Date 2021/6/21 16:09
 * @Info
 */
public class Demo {

    public static void main(String[] args) {
        PassObject passObject = new PassObject();
        Circle circle = new Circle();
        passObject.printAreas(circle,10);
    }
}

class Circle{

    double radius;

    public Double findArea(){
        return Math.PI * radius*radius;
    }
}

class PassObject{

    public void printAreas(Circle circle,int time){
        if (circle.radius < time){
            circle.radius++;
        }else if (circle.radius == time){
            return;
        }
        else {
            time--;
        }

        circle.findArea();
        System.out.println(circle.radius +" , "+circle.findArea());

        if (time <= 0){
            System.exit(1);
        }
        printAreas(circle, time);
    }

}
